From: kaf24@firebug.cl.cam.ac.uk Date: Tue, 2 May 2006 14:36:07 +0000 (+0100) Subject: This patch changes to format in which EIP is printed to be consistent on 64-bit regar... X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16108^2~27 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=da8197de83161eb685034e58d001158788211365;p=xen.git This patch changes to format in which EIP is printed to be consistent on 64-bit regardless of whether the addresses leading bits are set or clear. It additionally changes the formatting so that trailing spaces are avoided, and it suppresses the printing of empty records. It also prevents combining records with identical EIP but from different domains. It further changes the type of some variables from plain int to unsigned int, as that is yielding more efficient code on x86-64 (signed 32-bit array indices require explicit sign extension, whereas in most cases an extra copy can be avoided when the index type is unsigned, since all 32-bit operations already zero-extend their results). Signed-off-by: Jan Beulich --- diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index a83e9c566c..7e78e680e7 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -2917,7 +2917,7 @@ static inline unsigned int ptwr_eip_stat_hash( unsigned long eip, domid_t id ) static void ptwr_eip_stat_inc(u32 *n) { - int i, j; + unsigned int i, j; if ( ++(*n) != 0 ) return; @@ -2925,14 +2925,14 @@ static void ptwr_eip_stat_inc(u32 *n) *n = ~0; /* Re-scale all buckets. */ - for ( i = 0; i >= 1; } static void ptwr_eip_stat_update(unsigned long eip, domid_t id, int modified) { - int i, j, b; + unsigned int i, j, b; i = b = ptwr_eip_stat_hash(eip, id); @@ -2946,7 +2946,7 @@ static void ptwr_eip_stat_update(unsigned long eip, domid_t id, int modified) memset(ptwr_eip_stats[i].val,0, sizeof(ptwr_eip_stats[i].val)); } - if ( ptwr_eip_stats[i].eip == eip ) + if ( ptwr_eip_stats[i].eip == eip && ptwr_eip_stats[i].id == id) { for ( j = 0; j < ptwr_eip_stat_thresholdN; j++ ) if ( modified <= ptwr_eip_stat_threshold[j] ) @@ -2975,7 +2975,7 @@ void ptwr_eip_stat_print(void) { struct domain *e; domid_t d; - int i, j; + unsigned int i, j; for_each_domain( e ) { @@ -2983,11 +2983,11 @@ void ptwr_eip_stat_print(void) for ( i = 0; i < ptwr_eip_buckets; i++ ) { - if ( ptwr_eip_stats[i].eip && ptwr_eip_stats[i].id != d ) + if ( !ptwr_eip_stats[i].eip || ptwr_eip_stats[i].id != d ) continue; - printk("D %d eip %08lx ", - ptwr_eip_stats[i].id, ptwr_eip_stats[i].eip); + printk("D %5d eip %p ", + ptwr_eip_stats[i].id, (void *)ptwr_eip_stats[i].eip); for ( j = 0; j < ptwr_eip_stat_thresholdN; j++ ) printk("<=%u %4u \t",